package org.example.model;

/**
 * @BelongsProject: Dynamic-relationship-binding
 * @BelongsPackage: org.example.model
 * @Author: dengxiyan
 * @CreateTime: 2025/07/04  10:49
 * @Description: TODO
 * @Version: 1.0
 */
import javax.persistence.Entity;
import javax.persistence.Transient;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

@Entity
@Data
@EqualsAndHashCode(callSuper = true)
public class Student extends BaseEntity {
    private String name;
    private String studentId;
    @Transient
    private List<Course> courses = new ArrayList<>();  // 初始化并保持List类型
    @Transient
    @JsonIgnoreProperties("students") // 忽略supervisor中的students字段
    private Teacher supervisor;
}
